//
//  CarInfoTableViewCell.m
//  OneCreditTreasure
//
//  Created by iOS Tedu on 16/8/30.
//
//

#import "CarInfoTableViewCell.h"

@implementation CarInfoTableViewCell
#pragma mark - 生命周期 life cycle
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self leftLB];
        [self infoTF];
    }
    return self;
}

#pragma mark - 懒加载 lazy loading
- (UILabel *)leftLB {
    if(_leftLB == nil) {
        _leftLB = [[UILabel alloc] init];
        [self.contentView addSubview:_leftLB];
        [_leftLB mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(12);
            make.top.equalTo(8);
            make.right.equalTo(self.infoTF.mas_left).equalTo(-8);
            make.bottom.equalTo(-8);
        }];
        _leftLB.font = defaultFont;
    }
    return _leftLB;
}

- (UITextField *)infoTF {
    if(_infoTF == nil) {
        _infoTF = [[UITextField alloc] init];
        [self.contentView addSubview:_infoTF];
        [_infoTF mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(kScreenW / 3);
            make.top.equalTo(4);
            make.bottom.equalTo(-4);
            make.right.equalTo(-20);
        }];
        _infoTF.font = defaultFont;
        _infoTF.clearButtonMode = UITextFieldViewModeWhileEditing;
        _infoTF.textColor = [UIColor lightGrayColor];
    }
    return _infoTF;
}
@end
